<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>上传成功 - 会员中心</title>
    <!-- 引入 Tailwind CSS -->
    <script src="https://cdn.tailwindcss.com"></script>
    <!-- 引入 Font Awesome 图标 -->
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    
    <!-- 自定义 Tailwind 配置 -->
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#1677ff', // 主色调
                        success: '#52c41a', // 成功色
                        lightBg: '#f5f7fa', // 浅背景色
                    },
                    fontFamily: {
                        sans: ['Inter', 'system-ui', 'sans-serif'],
                    },
                },
            }
        }
    </script>
    
    <!-- 自定义工具类 -->
    <style type="text/tailwindcss">
        @layer utilities {
            .content-auto {
                content-visibility: auto;
            }
            .card-shadow {
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
            }
        }
    </style>
</head>
<body class="bg-lightBg min-h-screen flex items-center justify-center p-4">
    <div class="w-full max-w-2xl bg-white rounded-lg card-shadow p-8">
        <!-- 成功图标 -->
        <div class="flex justify-center mb-6">
            <div class="w-20 h-20 rounded-full bg-success/10 flex items-center justify-center">
                <i class="fa fa-check text-4xl text-success"></i>
            </div>
        </div>
        
        <!-- 标题和消息 -->
        <h1 class="text-2xl font-bold text-gray-800 text-center mb-2">上传成功！</h1>
        <p id="successMessage" class="text-gray-600 text-center mb-8">文件已成功上传并调用解析接口</p>
        
        <!-- 结果详情 -->
        <div id="resultDetails" class="mb-8 p-4 bg-lightBg rounded-md">
            <h3 class="text-lg font-semibold text-gray-800 mb-4">解析结果</h3>
            <div id="analyzeResult" class="text-gray-600 bg-white p-3 rounded-md border border-gray-200">
                解析结果将显示在这里...
            </div>
        </div>
        
        <!-- 操作按钮 -->
        <div class="flex flex-col sm:flex-row justify-center gap-4">
            <a href="index.html" class="px-6 py-3 bg-primary text-white rounded-md hover:bg-primary/90 transition-colors text-center">
                <i class="fa fa-upload mr-2"></i>上传新文件
            </a>
            <a href="#" class="px-6 py-3 border border-gray-300 text-gray-700 rounded-md hover:bg-gray-100 transition-colors text-center">
                <i class="fa fa-file-text-o mr-2"></i>查看我的文档
            </a>
        </div>
    </div>

    <!-- JavaScript 逻辑 -->
    <script>
        // 从URL参数中获取上传结果信息
        function getUrlParams() {
            const params = {};
            const queryString = window.location.search.substring(1);
            const pairs = queryString.split('&');
            for (let pair of pairs) {
                const [key, value] = pair.split('=');
                if (key) {
                    params[decodeURIComponent(key)] = decodeURIComponent(value || '');
                }
            }
            return params;
        }

        // 初始化页面数据
        document.addEventListener('DOMContentLoaded', () => {
            const params = getUrlParams();
            
            // 设置成功消息
            if (params.message) {
                document.getElementById('successMessage').textContent = decodeURIComponent(params.message);
            }
            
            // 设置解析结果
            if (params.analyzeResult) {
                try {
                    const resultObj = JSON.parse(decodeURIComponent(params.analyzeResult));
                    document.getElementById('analyzeResult').textContent = JSON.stringify(resultObj, null, 2);
                } catch (e) {
                    document.getElementById('analyzeResult').textContent = decodeURIComponent(params.analyzeResult);
                }
            }
        });
    </script>
</body>
</html>